package com.lvmama.rhino.pojo.comment.Enum;

/**
 * 好评率枚举
 */
public enum EnumForFavorRate {

    ONE(1, "1% ~ 10%"),
    TWO(2, "11% ~ 20%"),
    THREE(3, "21% ~ 30%"),
    FOUR(4, "31% ~ 40%"),
    FIVE(5, "41% ~ 50%"),
    SIX(6, "51% ~ 60%"),
    SEVEN(7, "61% ~ 70%"),
    EIGHT(8, "71% ~ 80%"),
    NINE(9, "81% ~ 90%"),
    TEN(10, "91% ~ 100%");

    private int value;
    private String showName;

    EnumForFavorRate(int value, String showName) {
        this.value = value;
        this.showName = showName;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getShowName() {
        return showName;
    }

    public void setShowName(String showName) {
        this.showName = showName;
    }

    /**
     * 根据值获取名称
     *
     * @param value
     * @return
     */
    public static String getFavorRateName(int value) {
        String name = "";
        for (EnumForFavorRate comment : EnumForFavorRate.values()) {
            if (value == comment.getValue()) {
                name = comment.getShowName();
                break;
            }
        }
        return name;
    }
}
